<template>
  <div class="mynotlog">
    <div class="mynotlog-content content">
      <span><</span>
      <router-link to="/">已有账号，去登录</router-link>
    </div>
    <div class="touxiang content">
      <img src="../../assets/images/头像.png" alt="" />
    </div>
    <div class="input content">
      <div>
        账号<input
          v-model="phone"
          type="text"
          placeholder="请输入您注册的手机号"
        />
      </div>
      <div class="yanzhengma">
        <div>
          <input v-model="phone1" type="text" placeholder="请输入您的验证码" />
        </div>
        <span @click="send" :disabled="disabled">发送验证码</span>
      </div>
    </div>
    <div class="mima content">
      <div>
        密码<input
          v-model="mi"
          type="text"
          placeholder="请输入您的密码6~12位"
        />
      </div>
      <div>
        密码<input
          v-model="ma"
          type="text"
          placeholder="请再次输入您的密码6~12位"
        />
      </div>
      <div>邀请码<input type="text" placeholder="请输入您的邀请码" /></div>
    </div>
    <div class="btn content" @click="regs">注册</div>
    <div class="btnn">点击注册表示已阅读并同意<span>《用户协议》</span></div>
  </div>
</template>
<style scoped>
.content {
  width: 375px;
  margin: 0 auto;
}
.mynotlog-content {
  display: flex;
  justify-content: space-between;
  margin-top: 30px;
  padding: 0 10px;
}
.mynotlog-content span {
  font-size: 20px;
  color: #333;
}
.touxiang {
  text-align: center;
  margin-top: 20px;
}
.input {
  margin-top: 20px;
  text-align: center;
}
.yanzhengma {
  display: flex;
  justify-content: center;
}
.yanzhengma span {
  background-color: rgb(9, 182, 116);
  height: 23px;
  line-height: 23px;
  margin: 10px 5px;
  padding: 0 5px;
  color: #fff;
}
.input input {
  margin: 10px 0;
}
.mima {
  text-align: center;
}
.mima div {
  padding: 10px 0;
}
.btn {
  width: 300px;
  margin-top: 20px;
  text-align: center;
  background-color: rgb(9, 182, 116);
  border-radius: 25px;
  color: #fff;
  margin: 0 auto;
}
.btnn {
  margin-top: 10px;
  text-align: center;
  font-size: 13px;
}
.btnn span {
  color: rgb(9, 182, 116);
}
</style>
<script setup>
import { useRouter } from "vue-router";
import { ref } from "vue";
const router = useRouter();
function msynot() {
  router.push("/");
}

let disabled = ref(false);
let timer = null;
let num = 60;
function send() {
  timePickerProps.value = '正在发送...';
  disabled.value = true;
  axios
    .post(
      "https://fc-mp-827be4c1-176f-4e1f-985a-621b4417eadf.next.bspapp.com/api/user/pub/sendSmsCode",
      {
        checkUserExist: "!exists",
        type: "reset-pwd",
        mobile: phone.value,
      }
    )
    .then(function (response) {
      console.log(response);
    })
    .catch(function (error) {
      console.log(error);
    });
}
let phone = ref("");
let phone1 = ref("");
let mi = ref("");
let ma = ref("");
let passwordMatch = ref(false);
import axios from "axios";
function regs() {
  axios
    .post(
      "https://fc-mp-827be4c1-176f-4e1f-985a-621b4417eadf.next.bspapp.com/api/user/pub/loginBySms",
      {
"mobile": phone.value, //自己的手机号,别乱写陌生人的，会被封号
"code": phone1.value, //验证码
"type": "register", //固定填写register
"password": mi.value //设置自己的密码
}
    )
    .then((res)=>{
        console.log(res)
    })
}
</script>
